Redesign key quantity extraction/insertion pipeline#205
Redesign key quantity extraction/insertion pipeline#205sbreitbart-NOAA wants to merge 2 commits intomainfrom
Conversation
…eline to add kqs to it in landings plot
New version checklist
|
|
|
||
| ### Make RDA ---- | ||
| if (make_rda) { | ||
|
|
There was a problem hiding this comment.
Is this chunk going to be unique to all plots? Like we won't be able to generalize this and make it more concise?
There was a problem hiding this comment.
Lines 102-108 are where key quantities are calculated for this plot (and I'd expect this is where each plot/table's KQs will be calculated too). The next couple of functions are where the generalization happens: in the exporting of the KQs into a csv, and the insertion of the KQs into the alt text/captions csv.
| # export df with updated captions and alt text to csv | ||
| utils::write.csv( | ||
| x = caps_alttext, | ||
| file = fs::path(getwd(), "captions_alt_text.csv"), |
There was a problem hiding this comment.
I think this assumes that this file is in the wd. We either need to document that or allow it to be changed
There was a problem hiding this comment.
Yes, for sure! I was thinking the same thing. I'll set the wd as the export folder for now but we can make that customizable later
|
Also, what is the use of the key_quantities.csv for the user/function? Could it be a temporary file? Maybe you can make it an excel file and use tabs or something? Just a thought in order to reduce the number of files a user has to keep track of. |
It's a file where they can find their model's key quantities. I think it should be permanent, especially because it could be useful when sending information to SIS. They won't have to edit it unless they need to add or edit a key quantity, but I don't expect they'll need to do that very often |


Since we've redesigned the figures and tables to be more flexible on the user's end (i.e., they can more powerfully customize what their plots show by specifying plot arguments), the existing pipeline to extract key quantities and then insert them into the captions/alt text template doesn't work for several quantities anymore. Basically, key quantities need to reflect the users' data summarization, grouping specifications, filtering, etc.
To fix this, I've begun redesigning this pipeline so that key quantities are:
write_captions(), and then the remainders withadd_more_key_quants())This pipeline should also resolve issues of key quantity calculation dependency, where the calculation of one kq depends on the prior calculation of another. If they're all calculated and stored in a single place, all can be referenced for future calculations of other quantities.
This will also facilitate sharing the kqs with SIS.
Ultimately,
write_captions()andadd_more_key_quants()should become redundant and removed.@Schiano-NOAA I've just made a pilot draft focused on
plot_landings(), which was a simple example. Could you please take a look and let me know if this is on the right track?